<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets" >
	<f:view locale="#{salaoMB.internacionalizacao.currentLocale}">
<h:head>
	<title>Login</title>
	<script type="text/javascript">
			function submeterForm(){
				var form = document.forms['loginForm'];
				form.action = "j_security_check";
				form.submit();
			}
	</script>	
	<link rel="stylesheet" href="../css/salao.css" type="text/css"	media="screen" />
</h:head>
<h:body>	
	<h:form id="loginForm" method="post" prependId="false">
	<p:ajaxStatus onstart="status.show();" oncomplete="status.hide();" />
	<p:dialog widgetVar="status" modal="true" closable="false" header="Status" draggable="false" >
		<p:graphicImage value="img/ajaxloadingbar.gif"/>
		<h:outputText value="Aguarde..." />
	</p:dialog>
	<p:growl id="messages" showDetail="false"/>
	<table align="right" width="10">
		<tr>
			<td>
				<h:panelGrid columns="2" style="position:relative;margin-top:10px">
				<p:selectOneMenu value="#{salaoMB.internacionalizacao.selectLocale}" valueChangeListener="#{salaoMB.internacionalizacao.localeChanged}" rendered="true" immediate="true">
						<f:selectItems value="#{salaoMB.internacionalizacao.availableLocales}" itemLabel="Selecione"/>
				</p:selectOneMenu>
				<h:commandButton value="OK" rendered="true"/>
				</h:panelGrid>
			</td>
		</tr>	
	</table>
	<table align="center" width="40%">
	<tr>
		<td>
			<p:panel header="Login - Sistema de Agendamento de Salão de Beleza Online">

				<h:panelGrid columns="2" width="100%" style="margin-top:10px;align:center">
					<h:outputText value="#{msg.login}" />
					<p:inputText value="#{loginMB.login.login}" id="j_username" maxlength="20" size="30"
						title="Login de Acesso" />
						
					<h:outputText value="#{msg.senha}" />
					<h:inputSecret value="#{loginMB.login.senha}" id="j_password" maxlength="20" size="30"
						title="Senha" />							
							
				</h:panelGrid>
				<h:panelGrid columns="1" width="100%" style="position:relative;margin-top:10px">
					<h:panelGroup>
						<p:commandButton type="reset" value="#{msg.limpar}" />
						<p:commandButton type="submit" value="#{msg.acessar}" ajax="false" onclick="javascript:submeterForm();" onkeydown="javascript:submeterForm();" />
						<h:commandLink value="#{msg.novoUsuario}" action="/novoUsuario.xhtml"/>
					</h:panelGroup>	
					
				
				</h:panelGrid>
				</p:panel>
			</td>
		</tr>
		</table>		
	</h:form>
</h:body>
</f:view>
</html>